package magicbattle.game.character;

public class Attribute {

	private float health;
	private float mana;

	private int maxAttack;
	private int minAttack;

	// attacks per 10ms
	private int attackSpeed;

	private int strength;
	private int agility;
	private int intelligence;

	private int critChance;
	private int critAmount;
	
	// regerneration per 10ms
	private float healthRegeneration;
	private float manaRegeneration;
	
	private int armor;
	private int magicResistance;
	
	// chance to dodge
	private int dodge;

	
	public Attribute(float health, float mana, int maxAttack, int minAttack,
			int attackSpeed, int strength, int agility, int intelligence,
			int critChance, int critAmount, float healthRegeneration,
			float manaRegeneration, int armor, int magicResistance, int dodge) {
		super();
		this.health = health;
		this.mana = mana;
		this.maxAttack = maxAttack;
		this.minAttack = minAttack;
		this.attackSpeed = attackSpeed;
		this.strength = strength;
		this.agility = agility;
		this.intelligence = intelligence;
		this.critChance = critChance;
		this.critAmount = critAmount;
		this.healthRegeneration = healthRegeneration;
		this.manaRegeneration = manaRegeneration;
		this.armor = armor;
		this.magicResistance = magicResistance;
		this.dodge = dodge;
	}
	
	public Attribute() {
		super();
		this.health = 0F;
		this.mana = 0F;
		this.maxAttack = 0;
		this.minAttack = 0;
		this.attackSpeed = 0;
		this.strength = 0;
		this.agility = 0;
		this.intelligence = 0;
		this.critChance = 0;
		this.critAmount = 0;
		this.healthRegeneration = 0F;
		this.manaRegeneration = 0F;
		this.armor = 0;
		this.magicResistance = 0;
		this.dodge = 0;
	}
	
	public void addAttribute(Attribute givenAttribute) {
		this.health += givenAttribute.getHealth();
		this.mana += givenAttribute.getMana();
		this.maxAttack += givenAttribute.getMaxAttack();
		this.minAttack += givenAttribute.getMinAttack();
		this.attackSpeed += givenAttribute.getAttackSpeed();
		this.strength += givenAttribute.getStrength();
		this.agility += givenAttribute.getAgility();
		this.intelligence += givenAttribute.getIntelligence();
		this.critChance += givenAttribute.getCritChance();
		this.critAmount += givenAttribute.getCritAmount();
		this.healthRegeneration += givenAttribute.getHealthRegeneration();
		this.manaRegeneration += givenAttribute.getManaRegeneration();
		this.armor += givenAttribute.getArmor();
		this.magicResistance += givenAttribute.getMagicResistance();
		this.dodge += givenAttribute.getDodge();
	}
	
	public int randomOfAttack() {
		return (int)((Math.random() + this.minAttack) + (this.maxAttack - this.minAttack));
	}
	
	public float getHealth() {
		return health;
	}

	public void addHealth(float change) {
		this.health += change;
	}

	public float getMana() {
		return mana;
	}

	public void setMana(float mana) {
		this.mana -= mana;
	}

	public int getMaxAttack() {
		return maxAttack;
	}

	public void setMaxAttack(int maxAttack) {
		this.maxAttack = maxAttack;
	}

	public int getMinAttack() {
		return minAttack;
	}

	public void setMinAttack(int minAttack) {
		this.minAttack = minAttack;
	}

	public int getAttackSpeed() {
		return attackSpeed;
	}

	public void setAttackSpeed(int attackSpeed) {
		this.attackSpeed = attackSpeed;
	}

	public int getStrength() {
		return strength;
	}

	public void setStrength(int strength) {
		this.strength = strength;
	}

	public int getAgility() {
		return agility;
	}

	public void setAgility(int agility) {
		this.agility = agility;
	}

	public int getIntelligence() {
		return intelligence;
	}

	public void setIntelligence(int intelligence) {
		this.intelligence = intelligence;
	}

	public int getCritChance() {
		return critChance;
	}

	public void setCritChance(int critChance) {
		this.critChance = critChance;
	}

	public int getCritAmount() {
		return critAmount;
	}

	public void setCritAmount(int critAmount) {
		this.critAmount = critAmount;
	}

	public float getHealthRegeneration() {
		return healthRegeneration;
	}

	public void setHealthRegeneration(float healthRegeneration) {
		this.healthRegeneration = healthRegeneration;
	}

	public float getManaRegeneration() {
		return manaRegeneration;
	}

	public void setManaRegeneration(float manaRegeneration) {
		this.manaRegeneration = manaRegeneration;
	}

	public int getArmor() {
		return armor;
	}

	public void setArmor(int armor) {
		this.armor = armor;
	}

	public int getMagicResistance() {
		return magicResistance;
	}

	public void setMagicResistance(int magicResistance) {
		this.magicResistance = magicResistance;
	}

	public int getDodge() {
		return dodge;
	}

	public void setDodge(int dodge) {
		this.dodge = dodge;
	}

}
